#include<AC_DFA.h>
#include<iostream>
using namespace std;

int main()
{
    AC_DFA dfa;
    dfa.AddKeyword("ef",1,2,NULL);
    dfa.AddKeyword("f",2,3,NULL);
    dfa.AddKeyword("cdef",3,4,NULL);
    dfa.AddKeyword("abcdef",4,5,NULL);
    dfa.AddKeyword("abcd",5,6,NULL);
    dfa.BuildAll();
    int index=-1;
    dfa.Find("1234cdefabcdabcdef23",index);
    while(index!=-1)
    {
        cout<<"Find "<<dfa.GetKeywords(index)<<endl;
        index=dfa.GetNext(index);
    }
    return 0;
}
